//
//  Entities.h
//  FilamentDemo
//
//  Created by jerry on 2020/2/28.
//  Copyright © 2020 jerry. All rights reserved.
//

#import <Foundation/Foundation.h>

#include <filament/Engine.h>
#include <filament/IndirectLight.h>
#include <filament/RenderableManager.h>
#include <filament/Renderer.h>
#include <filament/Scene.h>
#include <gltfio/SimpleViewer.h>
#include <filament/Skybox.h>
#include <filament/TransformManager.h>
#include <filament/View.h>
#include <math/quat.h>
#import <simd/simd.h>
#include <string>
NS_ASSUME_NONNULL_BEGIN



class MyPlaneEntity {
public:
    MyPlaneEntity();
    ~MyPlaneEntity();
    utils::Entity entity;
    
    std::string identifier;
    
    filament::math::float4 * meshVertexs = nullptr;
    uint16_t meshVertexCount;
    uint16_t *triangleIndices = nullptr;
    uint16_t triangleIndexCount;
    
    filament::math::float4 * boundaryVertexs = nullptr;
    uint16_t boundaryVertexCount;
    uint16_t *boundaryIndices = nullptr;
    uint16_t boundaryIndexCount;
};

class MyLineEntity {
public:
    MyLineEntity();
    ~MyLineEntity();
    utils::Entity entity;
    
    filament::math::float4 * vertexs = nullptr;
    uint16_t *indices = nullptr;
    uint16_t indexCount;
    filament::MaterialInstance *matInstance;
};


class LineEntityDataSource {
public:
    LineEntityDataSource(filament::math::float3 *vertexs, uint16_t verCount);
    ~LineEntityDataSource();
    utils::Entity entity;
    
    filament::math::float3 * vertexs;
    uint16_t verCount;
    uint16_t *indices;
    uint16_t indexCount;
    filament::MaterialInstance *matInstance;
};

class TrianglesEntityDatasource {
public:
    TrianglesEntityDatasource();
    ~TrianglesEntityDatasource();
    utils::Entity entity;
    
    filament::math::float3 *vertexs = nullptr;
    uint16_t verCount;
    
    uint16_t *indices = nullptr;
    uint16_t indexCount;
    
    filament::MaterialInstance *matInstance;
    filament::math::quatf *tagnets = nullptr;
    filament::math::float2 *uv = nullptr;
};

class ShadowablePlaneEntityInfo {
public:
    ShadowablePlaneEntityInfo();
    ~ShadowablePlaneEntityInfo();
    
    utils::Entity entity;
    
    filament::math::float4 *vertexs = nullptr;
    uint16_t vertexCount;
    
    uint16_t triangleCount;
    uint16_t *triangleIndices = nullptr;
    
    filament::math::quatf* tangents = nullptr;
    filament::MaterialInstance *matInstance = nullptr;
};

class GlbEntityInfo {
public:
    GlbEntityInfo();
    ~GlbEntityInfo();
    
    utils::Entity entity;
    gltfio::FilamentAsset* asset = nullptr;
};

NS_ASSUME_NONNULL_END
